package com.example.hms.ulit;

public class ResultSubmit {
    public static Result success(Object data) {
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        result.setMessage("操作成功");
        System.out.println("调用成功方法0-1");
        return result;

    }

    public static Result success(Object data, String message) {
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        result.setMessage(message);
        System.out.println("调用成功方法0-2");
        return result;

    }

    public static Result error( String message) {
        Result result = new Result();
        result.setCode(-1);
        result.setMessage(message);
        return result;
    }

    public static Result fail( ) {
        Result result = new Result();
        result.setCode(-1);
        result.setMessage("服务器错误，请联系维护人员");
        return result;
    }
}
